{% extends "base.html" %}

{% block boxname %}Change Answer{% endblock %}

{% block content %}

{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}

{% if answered == None %}

    {{ question }}

    <form action="{% url edit input_id=question.id %}" method="post">
        {% csrf_token %}
        {% for answer in question.answer_set.all %}
            <input type="radio" name="answer" id="answer{{forloop.counter}}" value="{{answer.id}}" />
            <label for="answer{{forloop.counter}}">{{answer.answer}}</label><br />
        {% endfor %}
        <input type="hidden" name="user_id" value="{{ user.id }}" />
        <input type="submit" value="answer" />
    </form>

{{ answered.answer }}
{{ answered }}

{% else %}

    {{ answered }}

{% endif %}

{% endblock %}
